#include <stdio.h>

int main_12()
{
    int n, last, cur, cnt = 1, i;
    scanf("%d%d", &n, &last);
    for (i = 2; i <= n; i++) {
        scanf("%d", &cur);
        if (cur != last) cnt++;
        last = cur;
    }
    printf("%d\n", cnt);

    return 0;
}

